/**
 * 
 */
package org.lanqiao.netctoss.service.impl;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.lanqiao.netctoss.dao.AdminDao;
import org.lanqiao.netctoss.dao.PermissDao;
import org.lanqiao.netctoss.entity.Admin;
import org.lanqiao.netctoss.entity.Permiss;
import org.lanqiao.netctoss.service.PermissService;
import org.lanqiao.netctoss.util.GetSession;

/**
 * @author Administrator
 *
 */
public class PermissServiceImpl implements PermissService {


	@Override
	public int insertPermiss(Permiss permiss) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deletePermiss(Permiss permiss) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updatePermiss(Permiss permiss) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Permiss> selectPermiss() {
		// TODO Auto-generated method stub
		List<Permiss> la = new ArrayList<Permiss>();
		SqlSession session = GetSession.getSession();
		PermissDao permissDao = session.getMapper(PermissDao.class);
		la = permissDao.selectPermiss();
		session.commit();
		GetSession.close();
		return la;
	}
	/* (non-Javadoc)
	 * @see org.lanqiao.netctoss.service.PermissService#selectPermissByAdmin(org.lanqiao.netctoss.entity.Admin)
	 */
	@Override
	public List<Permiss> selectPermissByAdmin(Admin admin) {
		// TODO Auto-generated method stub
		List<Permiss> la = new ArrayList<Permiss>();
		SqlSession session = GetSession.getSession();
		PermissDao permissDao = session.getMapper(PermissDao.class);
		la = permissDao.selectPermissByAdmin(admin);
		session.commit();
		GetSession.close();
		return la;
	}


}
